package org.meetunexpectedly.service.video;

import com.baomidou.mybatisplus.extension.service.IService;
import org.meetunexpectedly.entity.video.Comment;
import org.meetunexpectedly.entity.vo.BasePage;

import java.util.Collection;

/**
 * @Description: 评论服务接口
 * @Author: pupil
 * @Date: 2025/1/19 下午 9:47
 */
public interface CommentService extends IService<Comment> {
    /**
     * 添加视频评论
     * @param videoId 视频id
     * @param parentId 父级评论id
     * @param content 评论内容
     * @param userId 用户id
     * @return
     */
    Boolean addComment(Long videoId, Long parentId, String content, Long userId);

    /**
     * 通过视频id获取一级评论
     * @param basePage
     * @param videoId
     * @return
     */
    Collection<Comment> getCommentByVideoId(BasePage basePage, Long videoId);

    /**
     * 通过顶级评论id获取子评论
     * @param basePage
     * @param rootId
     * @return
     */
    Collection<Comment> getCommentByRootId(BasePage basePage, Long rootId);

    /**
     * 根据id删除评论
     * @param commentId 评论id
     * @param userId 用户id
     * @return
     */
    Boolean deleteCommentById(Long commentId, Long userId);

    /**
     * 点赞/取消点赞
     * @param commentId 评论id
     * @return
     */
    Boolean thumbUpComment(Long commentId);
}
